package com.triones.ljr.controller.api;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.triones.ljr.entity.vo.AdductVO;
import com.triones.ljr.entity.vo.BannerVO;
import com.triones.ljr.service.AdductSerivce;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * api - 政策汇集
 *
 * @Author: triones
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/adduct")
public class ApiAdductController extends BaseController {

    private final AdductSerivce adductSerivce;

    /**
     *  type => 1:市级、2：国家级
     * 上级政策汇集列表
     * @return
     */
    @GetMapping("/list/{type}")
    public R<List<AdductVO>> list(@NotNull(message = "类型不能为空") @PathVariable(value = "type") Integer type) {
        return R.ok(adductSerivce.list(type));
    }
}
